import router from './router'
import NProgress from 'nprogress' // Progress 进度条
import 'nprogress/nprogress.css'// Progress 进度条样式
import Cookies from 'js-cookie'
import wxShare from './lib/wxShare'

router.beforeEach((to, from, next) => {
  // NProgress.start()
  console.log(to, from)
  console.log(Cookies.get('token'))
  if (Cookies.get('token')) {
    next()
    wxShare()
  } else {
    // NProgress.done()
    next()
  }
})

router.afterEach((to, from, next) => {
  NProgress.done() // 结束Progress
})
